#include "common/defines.h"
#include "activecoderequest.h"
#include "activecoderesponse.h"
#include "network/networkjsonresponse.h"
#include <json.h>
#include <QDebug>
#include <QUrl>

ActiveCodeRequest::ActiveCodeRequest(QString phone) :
    m_response(new ActiveCodeResponse()),
    m_phone(phone)
{
}


ActiveCodeRequest::~ActiveCodeRequest()
{
    delete m_response;
    m_response = NULL;
}


QUrl ActiveCodeRequest::url() const
{
    QString url = QString(REST_GET_ACTIVE_CODE_REQUEST).arg(m_phone);
    //qDebug() << "REST_GET_ACTIVE_CODE_REQUEST URL:";
    //qDebug() << url;
    return QUrl(url);
}


Network::JSONResponse &ActiveCodeRequest::jsonResponse()
{
    return *m_response;
}


const Network::JSONResponse &ActiveCodeRequest::jsonResponse() const
{
    return *m_response;
}
